<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="http://shop.com:5500/resources/css/back.css" />
	<script src="http://shop.com:5500/resources/js/jquery-1.11.3.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="http://shop.com:5500/resources/js/jquery-heima-0.0.1.js"></script>
	<title>商品列表</title>
	<style type="text/css">
		.prod_tr {
			text-align: center;
		}

		.prod_tr:hover {
			background-color: white;
		}
	</style>
	<script>
		$(function () {
			$.ajax({
				url: "http://api.shop.com:8080/product?md=findAll",
				type: "post",
				success: function (response) {
					// alert(response);
					// 字符串转对象
					var category = eval("(" + response + ")");
					var lists = category.data;
					var html = "";
					for (p of lists) {
						html += "<tr class=\"tr_odd prod_tr\">\n" +
							"\t\t\t\t\t\t\t\t\t<td >\n" +
							"\t\t\t\t\t\t\t\t\t\t" + p.pid + "\n" +
							"\t\t\t\t\t\t\t\t\t</td>\n" +
							"\t\t\t\t\t\t\t\t\t<td >\n" +
							"\t\t\t\t\t\t\t\t\t\t" + p.pname + "\n" +
							"\t\t\t\t\t\t\t\t\t</td>\n" +
							"\t\t\t\t\t\t\t\t\t<td align=\"left\" >\n" +
							"\t\t\t\t\t\t\t\t\t\t" + p.pdesc + "\n" +
							"\t\t\t\t\t\t\t\t\t</td>\n" +
							"\t\t\t\t\t\t\t\t\t<td >\n" +
							"\t\t\t\t\t\t\t\t\t\t" + p.market_price + "\n" +
							"\t\t\t\t\t\t\t\t\t</td>\n" +
							"\t\t\t\t\t\t\t\t\t<td >\n" +
							"\t\t\t\t\t\t\t\t\t\t\t" + p.is_hot + "\n" +
							"\t\t\t\t\t\t\t\t\t</td>\n" +
							"\t\t\t\t\t\t\t\t\t<td >\n" +
							"\t\t\t\t\t\t\t\t\t\t<img width=\"40\" src=\"http://shop.com:5500/" + p.pimage + "\">\n" +
							"\t\t\t\t\t\t\t\t\t</td>\n" +
							"\t\t\t\t\t\t\t\t</tr>";
					}
					$("#list").append(html);




				}
			})
		})
	</script>
</head>

<body>
	<table cellSpacing="1" cellPadding="0" width="100%" align="center" bgColor="#f5fafe" border="0">
		<tbody>
			<tr>
				<td align="center" bgColor="#afd1f3">
					<strong>商品列表</strong>
				</TD>
			</tr>
			<tr>
				<td align="right">
					<a href="add.html" target="mainFrame">添加</a>
				</td>
			</tr>
			<tr>
				<td align="center" bgColor="#f5fafe">
					<table id="list" cellspacing="0" cellpadding="1" bordercolor="gray" border="1"
						style=" WIDTH: 100%; WORD-BREAK: break-all;BORDER-COLLAPSE: collapse; WORD-WRAP: break-word">
						<tr
							style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3;text-align: center;">
							<td width="7%">
								序号
							</td>
							<td width="10%">
								商品名称
							</td>
							<td width="47%">
								商品描述
							</td>
							<td width="17%">
								商品价格
							</td>
							<td width="10%">
								是否热门
							</td>
							<td>
								商品图片
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr align="center">
				<td colspan="7">
					<a href="#">首页</a>|
					<a href="#">上一页</a>|
					<a href="#">1</a>
					<a href="#">2</a>
					<a href="#">3</a>
					<a href="#">4</a>
					<a href="#">5</a>
					<a href="#">下一页</a>|
					<a href="#">尾页</a>|
					第1页/共10页/共25条
				</td>
			</tr>
		</tbody>
	</table>
</body>

</html>